home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 26 (Anniversary Edition)
/
Volume 26 [Anniversary Edition] - JOGO DISK .iso
/
DEPOSITO
/
REmovido
/
Esportes
/
LightningBreak.swf
/
scripts
/
frame_1
/
DoAction_5.as
< prev
next >
Wrap
Text File
|
2006-06-13
|
3KB
|
73 lines
CLevel = function(xml)
{
this.level = xml;
this.needScore = 10;
this.draw();
};
CLevel.prototype.draw = function()
{
};
CLevel.prototype.serialize = function()
{
var i = 0;
while(i < _root.ballsAmount)
{
var obj = _root.balls[i];
var ball = this.level.firstChild.childNodes[i];
ball.attributes.id = obj.id;
ball.attributes.x = obj.x;
ball.attributes.y = obj.y;
i++;
}
return this.level;
};
CLevel.prototype.init = function()
{
var level = this.level.firstChild;
this.title = "Level " + _root.actLevel + ": " + unescape(level.attributes.title) + " " + (_root.superLevel <= 1 ? "" : _root.superLevel + 1);
this.description = unescape(level.attributes.desc);
this.needPottedRed = int(level.attributes.needred);
this.needPottedColor = int(level.attributes.needcolor);
this.needBreak = int(level.attributes.needbreak);
this.needExact = int(level.attributes.needexact);
this.needOrder = level.attributes.needorder;
this.dontRespotColors = int(level.attributes.dontRespotColors);
this.time = int(level.attributes.time);
this.frame = int(level.attributes.frame);
this.speedUp = level.attributes.speedup ne "" ? int(level.attributes.speedup) : 1;
_root.timer.speed = level.attributes.timespeed ne "" ? Number(level.attributes.timespeed) : 1;
this.skin = level.attributes.skin ne "" ? level.attributes.skin : "default";
this.colorSwap = int(level.attributes.colorswap);
_root.swapTimerThreashold = this.colorSwap != 1 ? (this.colorSwap != 2 ? 90 : 90) : 180;
this.friction = level.attributes.friction ne "" ? Number(level.attributes.friction) : _root.table.friction;
this.breakout = level.attributes.breakout ne "" ? 1 : 0;
var i = 0;
while(i < 6)
{
this["h" + i] = level.attributes["l" + i];
_root.lids[i].gotoAndStop(int(level.attributes["l" + i]) + 1);
i++;
}
var i = 0;
while(i < _root.ballsAmount)
{
var ball = _root.balls[i];
ball.x = _root.lvlProto[i].x + (Math.random() - 0.5) * _root.spotVariance;
ball.y = _root.lvlProto[i].y + (Math.random() - 0.5) * _root.spotVariance;
ball.reset();
i++;
}
for(var item in level.childNodes)
{
item = this.level.firstChild.childNodes[item];
if(item.nodeName === "b")
{
var ball = _root.balls[item.attributes.id];
ball.x = Number(item.attributes.x) + (Math.random() - 0.5) * _root.spotVariance;
ball.y = Number(item.attributes.y) + (Math.random() - 0.5) * _root.spotVariance;
ball.reset();
}
}
_root.cue._alpha = 0;
};